<?php
class Socialprofiles_Model_Insertsocialprofiles implements Socialprofiles_Model_Mainable {
    
    private $core_controller_tokencheckout;
    private $core_controller_notnull;
    
    private $excepted_result = 1;
    private $current_result;
    
    private $socialprofiles_data_insertsocialprofiles;

    public function main(array $variables = null) {
        $this->core_controller_notnull = new Core_Controller_Notnull;
        $this->core_controller_notnull->main($variables);
        $this->core_controller_tokencheckout = new Core_Controller_Tokencheckout;
        $this->core_controller_tokencheckout->main($variables['post']);
                
        $this->socialprofiles_data_insertsocialprofiles = new Socialprofiles_Data_Insertsocialprofiles;
        $this->current_result = $this->socialprofiles_data_insertsocialprofiles->main($variables);
        
        if(
                $this->current_result = $this->excepted_result
                ){
            header("Location: ".SITE_ROOT."ustawienia-spolecznosciowe.html");
        }
        else {
            header("Location: ".SITE_ROOT."ustawienia-spolecznosciowe.html");
        }
        
    }

}
